<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<f:metadata>
	<f:event listener="#{depositAccoutListManageBean.onLoad}"
		type="preRenderView"></f:event>
</f:metadata>

<h:body>
	<ui:composition template="/Group2/masterPage.xhtml">
		<ui:define name="content">
			<!-- start content -->
			<h:messages style="color:red" />
			<div id="content">
				<!--  start page-heading -->
				<div id="page-heading"></div>
				<!-- end page-heading -->
				<table border="0" width="100%" cellpadding="0" cellspacing="0"
					id="content-table">
					<h:form>
						<p:panel id="panel" header="Search Deposit Accounts"
							style="margin-bottom:10px;">
							<p:messages id="messages" />
							<h:panelGrid columns="4">
								<h:outputLabel value="IDCardNumber :" for="idCard" />
								<p:inputText id="idCard"
									value="#{depositAccoutListManageBean.searchValue}" size="20"
									required="true" label="idCard"
									title="Enter IDCard Number To Search"
									requiredMessage="Please Enter IDCard Number">
									<f:validateLength minimum="9" maximum="12" />
									<f:convertNumber />
								</p:inputText>
								<p:outputLabel />
								<h:commandButton styleClass="myButton"
									action="#{depositAccoutListManageBean.searchAccount()}"
									value="Search" />
							</h:panelGrid>
						</p:panel>
					</h:form>
					<tr>
						<td id="tbl-border-left"></td>
						<td>
							<!--  start content-table-inner ...................................................................... START -->
							<div id="content-table-inner">
								<!--  start table-content  -->
								<div id="table-content">
									<!--  start product-table ..................................................................................... -->
									<p:panel id="panel10" header="Deposit Account List" />
									<h:dataTable
										value="#{depositAccoutListManageBean.depositAccountList}"
										var="account" id="product-table" border="0" width="100%"
										cellpadding="0" cellspacing="0"
										headerClass="table-header-repeat line-left">
										<h:column>
											<f:facet name="header">
												Type
											</f:facet>
											<h:outputText value="#{account.accountType}" />
										</h:column>
										<h:column>
											<f:facet name="header">
												Account Number
											</f:facet>
											<h:outputText value="#{account.accountNumber}">
												<f:convertNumber type="number" />
											</h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">
												ID Card Number
											</f:facet>
											<h:outputText value="#{account.idCardNumber}">
												<f:convertNumber type="number" />
											</h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">
												First Name
											</f:facet>
											<h:outputText value="#{account.firstName}" />
										</h:column>
										<h:column>
											<f:facet name="header">
												Last Name
											</f:facet>
											<h:outputText value="#{account.lastName}" />
										</h:column>
										<h:column>
											<f:facet name="header">
												Balance
											</f:facet>
											<h:outputText value="#{account.accountBalance}">
												<f:convertNumber pattern="#,###,##0.00" />
											</h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">
												State
											</f:facet>
											<h:outputText value="#{account.accountState}" />
										</h:column>
										<h:column>
											<f:facet name="header">
												Options
											</f:facet>
											<h:form>
												<h:panelGrid columns="3">
													<h:commandButton styleClass="myButton"
														action="#{depositAccountAddFundsManageBean.getInfoOfTransaction}"
														value="    Add    " >
														<f:param name="selectedAccountID" value="#{account.accountNumber}"></f:param>	
													</h:commandButton>
													<h:commandButton styleClass="myButton"
														action="#{depositAccountWithdrawFundsManageBean.getInfoOfTransaction}"
														value="Withdraw" >
													<f:param name="selectedAccountID" value="#{account.accountNumber}"></f:param>
														</h:commandButton>
													<h:commandButton styleClass="myButton"
														action="#{depositAccountTransferFundsManageBean.getSenderInfo}"
														value="Transfer" >
													<f:param name="selectedAccountID" value="#{account.accountNumber}"></f:param>
														</h:commandButton>
												</h:panelGrid>
											</h:form>
										</h:column>
									</h:dataTable>
									<!--  end product-table................................... -->
									<!-- </form>-->
								</div>
								<!--  end content-table  -->
								<!--  start paging..................................................... -->

								<!--  end paging................ -->
								<div class="clear"></div>
							</div> <!--  end content-table-inner ............................................END  -->
						</td>
						<td id="tbl-border-right"></td>
					</tr>
					<tr>
						<th class="sized bottomleft"></th>
						<td id="tbl-border-bottom">&nbsp;</td>
						<th class="sized bottomright"></th>
					</tr>
				</table>
				<div class="clear">&nbsp;</div>
			</div>
			<!--  end content -->
			<div class="clear">&nbsp;</div>
		</ui:define>
	</ui:composition>

</h:body>
</html>
